var o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
    return typeof e;
} : function (e) {
    return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
};
tywx.BiStatLog = {
    BiStatInfo: null,
    init: function () {
        this.BiStatInfo = {}, this.getStaticInfo(), this.getTyInfo(), this.getLocationInfo(),
            this.getSystemInfo();
    },
    getStaticInfo: function () {
        this.BiStatInfo.IP = "#IP", this.BiStatInfo.receiveTime = "#receiveTime";
    },
    getTyInfo: function () {
        this.BiStatInfo.cloudId = tywx.SystemInfo.cloudId, this.BiStatInfo.gameId = tywx.SystemInfo.gameId,
            this.BiStatInfo.appId = tywx.SystemInfo.appId, this.BiStatInfo.clientId = tywx.SystemInfo.clientId,
            this.BiStatInfo.intClientId = tywx.SystemInfo.intClientId, this.BiStatInfo.userId = tywx.UserInfo.userId,
            this.BiStatInfo.uuid = tywx.Util.getLocalUUID(), this.BiStatInfo.gameVersion = tywx.SystemInfo.version,
            this.BiStatInfo.wxAppId = tywx.SystemInfo.wxAppId;
    },
    getUserId: function () {
        this.BiStatInfo.userId = tywx.UserInfo.userId;
    },
    getNetworkType: function () {
        this.BiStatInfo.networkType = tywx.StateInfo.networkType;
    },
    getLocationInfo: function (e) {
        var t = this;
        wx.getLocation({
            type: "wgs84",
            success: function (e) {
                t.BiStatInfo.latitude = e.latitude, t.BiStatInfo.longitude = e.longitude, t.BiStatInfo.speed = e.speed,
                    t.BiStatInfo.accuracy = e.accuracy;
            },
            complete: function () {
                e();
            }
        });
    },
    getSystemInfo: function () {
        var e = this;
        wx.getSystemInfo({
            success: function (t) {
                e.BiStatInfo.brand = t.brand, e.BiStatInfo.model = t.model, e.BiStatInfo.pixelRatio = t.pixelRatio,
                    e.BiStatInfo.screenWidth = t.screenWidth, e.BiStatInfo.screenHeight = t.screenHeight,
                    e.BiStatInfo.windowWidth = t.windowWidth, e.BiStatInfo.windowHeight = t.windowHeight,
                    e.BiStatInfo.language = t.language, e.BiStatInfo.wxVersion = t.version, e.BiStatInfo.systemVersion = t.system,
                    e.BiStatInfo.platform = t.platform, e.BiStatInfo.wxSDKVersion = t.SDKVersion, e.BiStatInfo.fontSizeSetting = t.fontSizeSetting;
            }
        });
    },
    sendEvent: function (e, t) {
        "object" != (void 0 === t ? "undefined" : o(t)) && (t = {}), this.getNetworkType(),
            this.getUserId(), this.BiStatInfo.eventId = e, this.BiStatInfo.eventParams = t,
            this.BiStatInfo.eventTime = Date.now().valueOf();
        this.getLocationInfo(function () {
            var e = JSON.stringify(tywx.BiStatLog.BiStatInfo), t = {
                url: tywx.SystemInfo.biLogServer,
                headers: ["Content-Type:text/plain"],
                postData: e
            };
            tywx.HttpUtil.httpPost(t);
        });
    }
}
